package com.wen.open.springframework.beans;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Wen
 * @date 2023/4/23 16:18
 */
public class PropertyValues {
    private List<PropertyValue> propertyValues = new ArrayList<>();

    public PropertyValue[] getPropertyValues() {
        return this.propertyValues.toArray(new PropertyValue[0]);
    }

    public void addPropertyValue(PropertyValue propertyValue) {
        this.propertyValues.add(propertyValue);
    }

    public PropertyValue getPropertyValue(String name) {
        for (PropertyValue pv : propertyValues) {
            if (pv.getName().equals(name)) {
                return pv;
            }
        }
        return null;
    }
}
